import request from "@/utils/request"
//查询部门全部
export function deptQueryAll() {
  return request({
    // url: `/joinservice/join-dept/getAllDepts`,
    url: `/joinservice/join-dept/getDeptInfoByClubId`,
    method: 'GET',
  })
}
//查询部门角色全部
export function roleQueryAll() {
  return request({
    // url: `/joinservice/join-role/getAllRoles`,
    url: `/joinservice/join-role/getRoleByClubId`,
    method: 'GET',
  })
}
//查询用户全部
export function userQueryAll(id) {
  return request({
    url: `/userservice/user-info/getUserInfoById/${id}`,
    method: 'GET',
  })
}
export function queryAll(page, limit, data) {
  return request({
    // url: `/joinservice/join-user-dept/getAllUserDepts/${page}/${limit}`,
    url: `/joinservice/join-user-dept/getUserDeptsByclubId/${page}/${limit}`,
    method: 'POST',
    data
  })
}
//新增
export function add(from) {
  return request({
    // url: `/joinservice/join-user-dept/bindOrUpdateUserDept`,
    url: `/joinservice/join-user-dept/bindOrUpdateUserDept`,
    method: 'POST',
    data: from
  })
}
//删除
export function del(id) {
  return request({
    url: `/joinservice/join-user-dept/deleteUserDeptById/${id}`,
    method: 'DELETE',
  })
}
export function unbindUserDept(userId, deptId) {
  return request({
    url: `/joinservice/join-user-dept/unbindUserDept/${userId}/${deptId}`,
    method: 'DELETE',
  })
}